<?php 
use yii\widgets\ActiveForm;
use yii\helpers\Html;
?>
	<div class="animate-dropdown"><!-- ========================================= BREADCRUMB ========================================= -->
<div id="breadcrumb-alt">
    <div class="container">
        <div class="breadcrumb-nav-holder minimal">
<!--            <ul>
                <li class="dropdown breadcrumb-item">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        shop by department
                    </a>
                    <ul class="dropdown-menu">
                        <li><a href="#">Computer Cases &amp; Accessories</a></li>
                        <li><a href="#">CPUs, Processors</a></li>
                        <li><a href="#">Fans, Heatsinks &amp; Cooling</a></li>
                        <li><a href="#">Graphics, Video Cards</a></li>
                        <li><a href="#">Interface, Add-On Cards</a></li>
                        <li><a href="#">Laptop Replacement Parts</a></li>
                        <li><a href="#">Memory (RAM)</a></li>
                        <li><a href="#">Motherboards</a></li>
                        <li><a href="#">Motherboard &amp; CPU Combos</a></li>
                        <li><a href="#">Motherboard Components</a></li>
                    </ul>
                </li>
                <li class="breadcrumb-item">
                    <a href="#">Home</a>
                </li>
                <li class="breadcrumb-item current">
                    <a href="#">shopping cart</a>
                </li>
            </ul>-->
        </div><!-- .breadcrumb-nav-holder -->
    </div><!-- /.container -->
</div><!-- /#breadcrumb-alt -->
<!-- ========================================= BREADCRUMB : END ========================================= --></div>
</header>
<!-- ============================================================= HEADER : END ============================================================= -->		<section id="cart-page">
    <div class="container">

        <!-- ========================================= CONTENT ========================================= -->
        <div class="col-xs-12 col-md-9 items-holder no-margin">
        <?php $form= ActiveForm::begin([
                    'action' => yii\helpers\Url::to(['order/add']),
       ])?>
            <?php $total=0;?>
            <?php foreach ((array)$data as $k=>$value):?>
            <input type="hidden" name="OrderDetail[<?php echo $k?>][productid]" value="<?php echo $value['productid'] ?>">
            <input type="hidden" name="OrderDetail[<?php echo $k?>][price]" value="<?php echo $value['price']?>"/>
            <input type="hidden" name="OrderDetail[<?php echo $k?>][productnum]" value="<?php echo $value['productnum']?>"/>
            <div class="row no-margin cart-item">
                <div class="col-xs-12 col-sm-2 no-margin">
                    <a href="#" class="thumb-holder">
                        <img class="lazy" alt="" src="<?php echo $value['cover']?>-coversmall" />
                    </a>
                </div>

                <div class="col-xs-12 col-sm-5 ">
                    <div class="title">
                        <a href="#"><?php echo $value['title']?></a>
                    </div>
                    <div class="brand">sony</div>
                </div> 

                <div class="col-xs-12 col-sm-3 no-margin">
                    <div class="quantity">
                        <div class="le-quantity">
                                <a class="minus" href="#reduce"></a>
                                <input name="productnum" id="<?php echo $value['cartid']?>" readonly="readonly" type="text" value="<?php echo $value['productnum']?>" />
                                <a class="plus" href="#add"></a>
                        </div>
                    </div>
                </div> 

                <div class="col-xs-12 col-sm-2 no-margin">
                    <div class="price">
                        <span><?php echo $value['price']?></span>
                    </div>
                    <a class="close-btn" href="<?php echo \yii\helpers\Url::to(['cart/del','cartid'=>$value['cartid']])?>"></a>
                </div>
            </div><!-- /.cart-item -->
            <?php $total+=$value['price']*$value['productnum']?>
            <?php endforeach;?>
            
        </div>
        <!-- ========================================= CONTENT : END ========================================= -->

        <!-- ========================================= SIDEBAR ========================================= -->

        <div class="col-xs-12 col-md-3 no-margin sidebar ">
            <div class="widget cart-summary">
                <h1 class="border">购物车</h1>
                <div class="body">
                    <ul class="tabled-data no-border inverse-bold">
                        <li>
                            <label>购物车合计</label>
                            <div class="value pull-right">$<span><?php echo $total?></span></div>
                        </li>
                        <li>
                            <label>运送</label>
                            <div class="value pull-right">免运费</div>
                        </li>
                    </ul>
                    <ul id="total-price" class="tabled-data inverse-bold no-border">
                        <li>
                            <label>订单合计</label>
                            <div class="value pull-right">$<span><?php echo $total?></span></div>
                        </li>
                    </ul>
                    <div class="buttons-holder">
                        <?php // echo Html::submitButton('结账',['class'=>'le-button big'])?>
                        <input type="submit" class="le-button big" value="结账"/>
                        <!--<a class="le-button big" href="#" >结帐</a>-->
                        <a class="simple-link block" href="http://localhost/~ibrahim/themeforest/HTML/mediacenter/upload/PHP/home" >继续购物</a>
                    </div>
                </div>
            </div><!-- /.widget -->

            <div id="cupon-widget" class="widget">
                <h1 class="border">使用优惠券</h1>
                <div class="body">
                    <form>
                        <div class="inline-input">
                            <input data-placeholder="输入优惠券码" type="text" />
                            <button class="le-button" type="submit">使用</button>
                        </div>
                    </form>
                </div>
            </div><!-- /.widget -->
        </div><!-- /.sidebar -->
        <!-- ========================================= SIDEBAR : END ========================================= -->
    <?php ActiveForm::end()?>
    </div>
</section>

